<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('人员列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li>
                            员工ID：<input type="text" name="crewId"/>
                        </li>
                        <li>
                            员工姓名：<input type="text" name="crewName"/>
                        </li>
                        <li>
                            员工状态：<select name="crewStatus" th:with="type=${@dict.getType('sys_normal_disable')}">
                            <option value="在职">在职</option>
                            <option value="离职">离职</option>
                            <option value="外出培训">外出培训</option>
                        </select>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('hcy:administration:edit')}]];
    var datas = [[${@dict.getType('sys_normal_disable')}]];
    var prefix = ctx + "hcy/administrations";

    $(function() {
        var options = {
            url: prefix + "/list",
            updateUrl: prefix + "/edit/{id}",
            modalName: "员工",
            columns: [{
                checkbox: true
            },
                {
                    field: 'crewId',
                    title: '员工ID'
                },
                {
                    field: 'crewName',
                    title: '员工姓名',
                },
                {
                    field: 'crewSex',
                    title: '员工性别',
                },
                {
                    field: 'crewJob',
                    title: '职位',
                },
                {
                    field: 'crewPhone',
                    title: '手机',
                },
                {
                    field: 'crewDepartment',
                    title: '所属部门',
                },
                {
                    field: 'crewCreatDate',
                    title: '入职时间',
                },
                {
                    field: 'crewStatus',
                    title: '状态',
                    align: 'center',
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.crewId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>